package com.hs.controller;

import com.hs.service.UploadService;
import com.hs.utils.ResultResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

@RestController
@Api(tags = "文件")
public class UploadController {

    @Resource
    private UploadService uploadService;

    @PostMapping("/uploadImage")
    @ApiOperation("上传单图片")
    public ResultResponse<String> uploadImg(@RequestPart(value = "image") MultipartFile image){
        return uploadService.uploadImage(image);
    }
}
